package com.zmj.entity;

public class User {
    private long id;
    private String userName;
    private String password;
    private UserInfo userInfo;

    public User(long id, String userName, String password, UserInfo userInfo) {
        this.id = id;
        this.userName = userName;
        this.password = password;
        this.userInfo = userInfo;
    }

    public User() {
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public UserInfo getUserInfo() {
        return userInfo;
    }

    public void setUserInfo(UserInfo userInfo) {
        this.userInfo = userInfo;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("{");
        sb.append("\"id\":")
                .append(id);
        sb.append(",\"userName\":\"")
                .append(userName).append('\"');
        sb.append(",\"password\":\"")
                .append(password).append('\"');
        sb.append(",\"userInfo\":")
                .append(userInfo);
        sb.append('}');
        return sb.toString();
    }
}
